#ifndef DATABASE_H
#define DATABASE_H

#include <QObject>
//#include <QSqlDatabase>
#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlError>
#include <QtSql/QSqlQuery>

class Database : public QObject
{

public:
    Database();
    ~Database();


    bool connect();
    bool disconnect();
    //void fail (QString what);

    bool createTables();
    bool dropTables();

    bool selectUser(int user_id, QString password);
    bool setAdmin(QString password1, QString password2);
    bool setUser(QString password1, QString password2);

private:
    void fail(QString what);
    QSqlDatabase db;
    QSqlQuery query;

};

#endif // DATABASE_H
